package com.bjpowernode.springboot.web;
import com.bjpowernode.springboot.domain.Img;
import com.bjpowernode.springboot.domain.Talk;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * Copyright (C), 2021-2021, 颜子初
 * Author: yan
 * Date: 2021/11/8 16:10
 * FileName: TitleController
 * Description: 
 */
@RestController
@RequestMapping("/talk")
public class TalkController {
        Img img=new Img("./img/view.a5f5c10f.png");
        Talk talk1 =new Talk(1,"天1津优惠券","美食","$50","是个美食优惠券",img);
        Talk talk2 =new Talk(2,"天2津优惠券","美食","$50","是个美食优惠券",img);
        Talk talk3 =new Talk(3,"天3津优惠券","美食","$50","是个美食优惠券",img);
        Talk talk4 =new Talk(4,"天4津优惠券","美食","$50","是个美食优惠券",img);
        Talk talk5 =new Talk(5,"天5津优惠券","美食","$50","是个美食优惠券",img);

        @ApiOperation(value = "查询")
        @PostMapping("/query")
        public List<Talk> query(){
            List<Talk> arrayList=new ArrayList();
            arrayList.add(talk1);
            arrayList.add(talk2);
            arrayList.add(talk3);
            arrayList.add(talk4);
            arrayList.add(talk5);
            for(Talk Talk :arrayList){
                System.out.println(Talk);
            }
            return arrayList;
        }


}
